home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 4.0 KB | 120 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFileSy.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #if !defined(FWFILESY_H) && !defined(__ODFRC__)
- #define FWFILESY_H
-
- #ifndef SLFILESY_H
- #include "SLFileSy.h"
- #endif
-
-
- //========================================================================================
- // FW_CAccessPermission
- //
- // This static class is a wrapper for FW_SAccessPermission, a "C" structure which can
- // be shared across SOM boundaries.
- //========================================================================================
-
- class FW_CAccessPermission
- {
- public:
- FW_CAccessPermission(unsigned long access = FW_kReadWrite,
- unsigned long deny = FW_kDenyReadWrite);
- // Main constructor, sets up the specified access privileges. Default privilege
- // is exclusive read/write access.
-
- FW_CAccessPermission(const FW_SAccessPermission& sPermission);
- FW_CAccessPermission(const FW_CAccessPermission& permission);
- // Copy constructor
-
-
- //===========================================================
- // Accessors
- //===========================================================
-
- unsigned long GetAccess() const;
- unsigned long GetDeny() const;
-
- //===========================================================
- // Operators
- //===========================================================
-
- FW_CAccessPermission& operator=(const FW_SAccessPermission& sPermission);
- FW_CAccessPermission& operator=(const FW_CAccessPermission& permission);
- // Assignment operator.
-
- FW_Boolean operator==(const FW_SAccessPermission& permission) const;
- // Equality operator.
-
- FW_Boolean operator!=(const FW_SAccessPermission& permission) const;
- // Inequality operator.
-
- operator FW_SAccessPermission&();
- operator FW_SAccessPermission*();
-
- private:
-
- FW_SAccessPermission fRep;
- };
-
-
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::GetAccess
- //----------------------------------------------------------------------------------------
- inline unsigned long FW_CAccessPermission::GetAccess() const
- {
- return fRep.fAccess;
- }
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::GetDeny
- //----------------------------------------------------------------------------------------
- inline unsigned long FW_CAccessPermission::GetDeny() const
- {
- return fRep.fDeny;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::operator=
- //----------------------------------------------------------------------------------------
- inline FW_CAccessPermission& FW_CAccessPermission::operator=(const FW_CAccessPermission& permission)
- {
- return (FW_CAccessPermission::operator=(permission.fRep));
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::operator!=
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_CAccessPermission::operator!=(const FW_SAccessPermission& permission) const
- {
- return (!FW_CAccessPermission::operator==(permission));
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::operator FW_SAccessPermission&
- //----------------------------------------------------------------------------------------
- inline FW_CAccessPermission::operator FW_SAccessPermission&()
- {
- return fRep;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CAccessPermission::operator FW_SAccessPermission*
- //----------------------------------------------------------------------------------------
- inline FW_CAccessPermission::operator FW_SAccessPermission*()
- {
- return &fRep;
- }
-
- #endif
-
-
-